var http = require('http');
var router = require('./view/router');
// console.log(router);/输入函数数组对象；
// console.log(name.sayName());
http.createServer(function (request, response) {
    response.writeHead(200, {
        'Content-Type': 'text/html;charset=utf8'
    });
    // response.write('hello world!');
    // response.end();
    // console.log('hello');
    if (request.url!=='/favicon.ico') {
        // console.log('hello!~~~')
        // console.log(request.url);//输出/；
        var path=request.url.replace(/\//,'');
        router[path](response);
    }
    // response.end('hello world! node.js!');
}).listen(8000);
console.log('sever is running at 8000');